<?php
/**
 * Created by PHPStorm
 * User: xiest
 * Date: 2021/4/6
 * Email: <939369942@qq.com>
 */
namespace basic\traits;

trait Error
{
    public $error;

    public function setError(?string $error=null)
    {
        $this->error = $error?$error:'未知错误';
        return false;
    }


    public function getError()
    {
        $error = $this->error;
        $this->error = null;
        return $error;
    }

}